package com.furtherstar.web.context;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

import com.yummy.web.config.SecurityProperties;
import com.yummy.web.context.RedisSessionManager;
import com.yummy.web.context.SessionManager;

@Configuration
public class SecurityConfiguration {
	
	@Bean
	@ConditionalOnMissingBean(SessionManager.class)
	public RedisSessionManager redisSessionManager(StringRedisTemplate stringRedisTemplate, SecurityProperties securityProperties) {
		return new RedisSessionManager(stringRedisTemplate, securityProperties);
	}
}
